package com.wonderland.sail.mybatis.parser;

import com.wonderland.sail.mybatis.model.Dialect;
import com.wonderland.sail.mybatis.parser.impl.MysqlParser;
import com.wonderland.sail.mybatis.parser.impl.OracleParser;

/**
 * Created by gaoxinyu on 2015-05-20.
 */
public class ParseFactory {

    public static SqlParser getParse(String strDialect){
        Dialect dialect =Dialect.of(strDialect);
        SqlParser sqlParser = null;
        switch (dialect) {
            case mysql:
            case mariadb:
            case sqlite:
                sqlParser = new MysqlParser();
                break;
            case oracle:
                sqlParser = new OracleParser();
                break;
        }
        return sqlParser;

    }
}
